package hust.ioic.oa.utils;

public class MsgInfo {
	/**
	 * 错误码
	 * 0代表成功，非0代码失败
	 */
	private int code;

	private String message;
	
	public MsgInfo(){
		code  = 0;
		message = new String();
	}
	
	public MsgInfo(int code, String message){
		this.code = code;
		this.message = message;
	}
	
	public void reset(int code, String message){
		this.code = code;
		this.message = message;
	}
	
	/**
	 * @return the code
	 */
	public int getCode() {
		return code;
	}

	/**
	 * @param code the code to set
	 */
	public void setCode(int code) {
		this.code = code;
	}

	/**
	 * @return the message
	 */
	public String getMessage() {
		return message;
	}

	/**
	 * @param message the message to set
	 */
	public void setMessage(String message) {
		this.message = message;
	}
	
	public boolean error(){
		return this.code != 0;
	}
	
	public boolean success(){
		return this.code == 0;
	}
}
